<!-- 底部 -->
<div class="footer">
    <nav class="footer-bar">
        <div class="tab-item" onclick="setMenu(0)">
            <a href="{:url('/')}">
                <span class="mui-icon mui-icon-home"></span>
                <span class="mui-tab-label">首页</span>
            </a>
        </div>
        <div class="tab-item" onclick="setMenu(1)">
            <a href="/home/course">
                <span class="mui-icon mui-icon-search"></span>
                <span class="mui-tab-label">搜索</span>
            </a>
        </div>
        <div class="tab-item" onclick="setMenu(2)">
            <a href="/home/educator">
                <span class="iconfont teacher">&#xe63a;</span>
                <span class="mui-tab-label">名师</span>
            </a>
        </div>
        <div class="tab-item" onclick="setMenu(3)">
            <a href="{:url('home/center/index')}">
                <span class="mui-icon mui-icon-contact"></span>
                <span class="mui-tab-label">我的</span>
            </a>
        </div>
    </nav>
</div>
<script>
    var activeIndex = localStorage.getItem("menu")
    if(!activeIndex){
        localStorage.setItem("menu",0)
    }
    $($(".footer .tab-item")[activeIndex]).prop("class","tab-item  mui-active")
    function setMenu(index){
        localStorage.setItem("menu",index)
    }
</script>